//
//  TT_OSSManager.h
//  ZKGX
//
//  Created by 王洋 on 2020/3/12.
//  Copyright © 2020 王洋. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface TT_OSSManager : NSObject

typedef void (^finishBlock)(id data);
typedef void (^FailedBlock)(NSError *error);

@property(copy,nonatomic)finishBlock finishBlock;
@property(copy,nonatomic)FailedBlock failedBlock;


typedef void (^UploadProgress)(NSInteger index);

+(void)uploadPhoto:(NSMutableArray <NSData *>*)imageArray
              type:(NSString *)imageType
       FinishBlock:(finishBlock)finishBlock
    UploadProgress:(UploadProgress)uploadProgress
       FailedBlock:(FailedBlock)failedBlock;


/**
 上传多张图片

 @param path 路径
 @param params 参数
 @param images 图片数组
 @param success success description
 @param failure failure description
 @param progress progress description
 */

+ (void)uploadImagesWithPath:(NSString *)path
                      params:(NSDictionary *)params
                      images:(UIImage *)images
                     success:(finishBlock)success
                     failure:(FailedBlock)failure
                    progress:(UploadProgress)progress;



+ (void)uploadVoicesWithPath:(NSString *)path
                      params:(NSDictionary *)params
                    filePath:(NSString *)filePath
                     success:(finishBlock)success
                     failure:(FailedBlock)failure
                    progress:(UploadProgress)progress;



+ (void)downloadAudioWithUrl:(NSString *)url
           saveDirectoryPath:(NSString *)directoryPath
                    fileName:(NSString *)fileName
                      finish:(finishBlock )finishBlock
                      failed:(FailedBlock)failed;

@end

NS_ASSUME_NONNULL_END
